<include file="Public/top" title = "里程密-网站配置" />
<link href="__PUBLIC__/Default/jquery-upload-file/css/uploadfile.css" rel="stylesheet">
<link href="__PUBLIC__/Default/jquery-upload-file/css/uploadfile.custom.css" rel="stylesheet">

        <!-- start left -->
<include file="Public/left"/>
         <!-- end left -->
        <div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-10">
                    <h2>网站配置</h2>
                </div>
                <div class="col-lg-2">

                </div>
            </div>
        <div class="row">
            <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <!-- <h5>All form elements <small>With custom checbox and radion elements.</small></h5> -->
                            <div class="ibox-tools">
                                <a class="collapse-link">
                                    <i class="fa fa-chevron-up"></i>
                                </a>
                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                    <i class="fa fa-wrench"></i>
                                </a>
                                <ul class="dropdown-menu dropdown-user">
                                    <li><a href="#">Config option 1</a>
                                    </li>
                                    <li><a href="#">Config option 2</a>
                                    </li>
                                </ul>
                                <a class="close-link">
                                    <i class="fa fa-times"></i>
                                </a>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <form method="post" class="form-horizontal" action="{:U('Site/doedit',array('id'=>$arr['id']))}" enctype="multipart/form-data">
                                <div class="form-group has-success"><label class="col-sm-4 control-label">网站标题</label>

                                    <div class="col-sm-8"><input type="text" class="form-control" name="title" required value = "{$arr.title}"></div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">网站名称</label>

                                    <div class="col-sm-8"><input type="text" class="form-control" name="name" required value = "{$arr.name}"></div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">副标题</label>

                                    <div class="col-sm-8"><input type="text" class="form-control" name="set_content" required value = "{$arr.set_content}"></div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">管理员邮箱</label>

                                    <div class="col-sm-8"><input type="text" class="form-control" name="admin_email" required value = "{$arr.admin_email}"></div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">上传文件大小限制(M为单位 填写数字 例如8 就是8M 0为不限制)</label>

                                    <div class="col-sm-8"><input type="text" class="form-control" name="file_size" required value = "{$arr.file_size}"></div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">网站关键字</label>
                                    <div class="col-sm-8"><textarea name = "keywords" required class="form-control">{$arr.keywords}</textarea></div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">网站描述</label>
                                    <div class="col-sm-8"><textarea name = "description" required class="form-control">{$arr.description}</textarea></div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">网站ICP备案号</label>
                                    <div class="col-sm-8"><textarea name = "icp" required class="form-control">{$arr.icp}</textarea></div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">网站统计代码</label>
                                    <div class="col-sm-8"><textarea name = "statistics" required class="form-control">{$arr.statistics}</textarea></div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">邀请码说明</label>
                                    <div class="col-sm-8"><textarea name = "code" required class="form-control">{$arr.code}</textarea></div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">友情链接说明</label>
                                    <div class="col-sm-8"><textarea name = "friend_link" required class="form-control">{$arr.friend_link}</textarea></div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">网站LOGO</label>
                                <div class="col-sm-4"><div id="fileuploader">上传</div></div>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control" name="logo" required value = "{$arr.logo}" id = "logo">
                                    <div style="height: 170px;width: 100%;padding: 15px;"><img src="{$arr.logo}" height  = "170px;"></div>
                                </div>
                                </div>
                                     <div class="hr-line-dashed"></div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">注册是否需要注册码</label>
                                    <div class="col-sm-3">
                                        <select name="userStatus">
                                            <option value="0" <if condition = "$arr.userstatus eq 0">selected</if>>不需要</option>
                                            <option value="1" <if condition = "$arr.userstatus eq 1">selected</if>>需要</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">注册支持会员投稿</label>
                                    <div class="col-sm-3">
                                        <select name="submission">
                                            <option value="0" <if condition = "$arr.submission eq 0">selected</if>>支持</option>
                                            <option value="1" <if condition = "$arr.submission eq 1">selected</if>>不支持</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">发表文章是否需要审核</label>
                                    <div class="col-sm-3">
                                        <select name="articleSatus">
                                            <option value="0" <if condition = "$arr.articlesatus eq 0">selected</if>>不需要</option>
                                            <option value="1" <if condition = "$arr.articlesatus eq 1">selected</if>>需要</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group has-success"><label class="col-sm-4 control-label">是否显示幻灯片</label>
                                    <div class="col-sm-3">
                                        <select name="slides_display">
                                            <option value="0" <if condition = "$arr.slides_display eq 0">selected</if>>显示</option>
                                            <option value="1" <if condition = "$arr.slides_display eq 1">selected</if>>不显示</option>
                                        </select>
                                    </div>
                                </div>
                                </div>
                               <div class="ibox-content">
                            <div class="text-center">
                            <input type="submit" value="保存" class="btn btn-primary" data-toggle="modal">
                            </div>

                    </div>
                            </form>
                        </div>
                </div>

            </div>
    <!-- start footer -->
                    <include file="Public/footer" />
                    <script src="__PUBLIC__/Default/jquery-upload-file/js/jquery.form.js"></script>
                    <script src="__PUBLIC__/Default/jquery-upload-file/js/jquery.uploadfile.js"></script>
                    <script type="text/javascript">
                        $(document).ready(function() {
                            $("#fileuploader").uploadFile({
                                url:"{:U('Site/upload_logo')}", //上传URL
                                fileName:"logo", //名称
                                maxFileCount:1, //上传文件数量
                                acceptFiles:"image/*", //类型
                                formData: {name:"logo"}, //通过FROM传过去的参数
                                onSuccess:function(files,data,xhr,pd){
                                    if(data.success){
                                        $(".ajax-file-upload-filename:contains("+files+")").after('<div style = "color:red;">上传成功</div>');
                                        $("#logo").val(data.file_path);
                                    }else{

                                    }
                                },
                                onError: function(files,status,errMsg,pd){
                                    $(".ajax-file-upload-filename:contains("+files+")").after('<div style = "color:red;">上传失败</div>');
                                    alert('上传失败请检查,错误提示：'+errMsg);
                                }
                            });
                        });
                    </script>
            <!-- end footer -->
        </div>
</script>
